package com.appbee.cm.client.gin;

import javax.inject.Singleton;

import com.appbee.cm.client.modular.presenter.ModulSelectionBoxPresenter;
import com.appbee.cm.client.modular.ui.ModulSelectPopup;
import com.appbee.cm.client.nav.presenter.NavAdminPresenter;
import com.appbee.cm.client.nav.presenter.NavSelectionBoxPresenter;
import com.appbee.cm.client.nav.presenter.SimpleNavPresenter;
import com.appbee.cm.client.nav.text.NavText;
import com.appbee.cm.client.nav.ui.NavAdminView;
import com.appbee.cm.client.nav.ui.NavSelectPopup;
import com.appbee.cm.client.nav.ui.SimpleNav;
import com.appbee.cm.client.regionunit.presenter.RegionActivity;
import com.appbee.cm.client.regionunit.ui.AddModulView;
import com.appbee.cm.client.regionunit.ui.ModulEditView;
import com.appbee.cm.client.regionunit.ui.RegionView;
import com.appbee.cm.client.startup.impl.DataRequestFactoryProvider;
import com.appbee.cm.shared.dataservice.DataRequestFactory;
import com.appbee.core.client.gin.CoreGinModul;
import com.appbee.core.client.modular.IModulRegistry;
import com.appbee.core.client.modular.impl.ModulRegistry;
import com.appbee.core.client.shell.IShell;
import com.appbee.core.client.shell.Shell;
import com.appbee.user.client.gin.WebUserProxyProvider;
import com.appbee.user.client.text.UserInfoStrings;
import com.appbee.user.shared.proxy.WebUserProxy;
import com.google.gwt.inject.client.AbstractGinModule;

public class CMCoreGinModul extends AbstractGinModule
{

	@Override
	protected void configure()
	{
		install(new CoreGinModul());
		bind(IShell.class).to(Shell.class).in(Singleton.class);
		// Modular
		bind(IModulRegistry.class).to(ModulRegistry.class).in(Singleton.class);
		bind(RegionActivity.AddModulView.class).to(AddModulView.class);
		bind(RegionActivity.View.class).to(RegionView.class);
		bind(RegionActivity.EditView.class).to(ModulEditView.class)
				.in(Singleton.class);
		bind(ModulSelectionBoxPresenter.SelectView.class)
				.to(ModulSelectPopup.class);

		// Nav
		bind(NavText.class).in(Singleton.class);
		bind(NavAdminPresenter.View.class).to(NavAdminView.class)
				.in(Singleton.class);
		bind(SimpleNavPresenter.View.class).to(SimpleNav.class);
		bind(NavSelectionBoxPresenter.SelectView.class)
				.to(NavSelectPopup.class);

		// Data service
		bind(DataRequestFactory.class)
				.toProvider(DataRequestFactoryProvider.class)
				.in(Singleton.class);
		// Users
		bind(WebUserProxy.class).toProvider(WebUserProxyProvider.class);
		bind(UserInfoStrings.class).in(Singleton.class);
	}

}
